new config option "absolutePaths", new exposed method "getReplacement", update README#42
Open
cape-dev wants to merge 3 commits intobenbria:masterfrom
Open
new config option "absolutePaths", new exposed method "getReplacement", update README#42cape-dev wants to merge 3 commits intobenbria:masterfrom
cape-dev wants to merge 3 commits intobenbria:masterfrom
Conversation
added 3 commits
May 25, 2016 13:41
Contributor
Author
|
It would be nice if the function would look for the config automatically. But i don't know how to accomplish that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi jwalton,
first of all thank you for the recent collaboration on
requireish. It was really fun and productive ;)I wanted to implement the new functionality in my project and faced new problems. I generally think, that it is not a good idea to replace the aliases with relative paths. There is no argument against replacing them always with absolute ones.
This was very crucial when I tried to use
proxyquierifywithaliasify. Let me explain the scenario:With
proxyquireifyyou are able to stub out arbitrary required modules. The problem here is... If you require a module through an alias in the original file which gehts replaced through a relative path fromaliasifyyou are not longer able to stub out this package because the require path for that module was manipulated and can not longer be stubbed out with the alias.Here comes a second problem in play. There is no method to manually get the replacement for an alias. I have to programmatically get the replacement path for the alias I want to stub out what is now possible with the new method
getReplacement.Now the absolute paths are important because the stubbed out path in the
proxyquireifystubs has to match the replaced require path in the original file. This is nearly impossible if you have your spec files in a completely different folder than your src files.Last but not least I updated the README with the new functionalities and edited the
requireishpart which was not exactly correct.